/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ac.GUI.treasury;

import ac.settings.dataModel;
import ac.settings.files;
import static ac.settings.rowsStatus.rowDeleted;
import ac.settings.sqlQuerys;
import ac.ui.controls.PCLPanel;
import ac.ui.custemItmes;
import ac.uitls.data;
import ac.uitls.propertiesOperation;
import java.awt.Component;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

/**
 *
 * @author ismail
 */
public class otherEx extends PCLPanel implements files, dataModel, sqlQuerys {

    ac.engin.treasury.otherEx x = new ac.engin.treasury.otherEx();
    propertiesOperation po = new propertiesOperation();
    data d = new data();

    public otherEx() {
        initComponents();
        onLoad();
        updateULable();
        updateTemplat();
        jd_date.setDate(new Date());

        updateindex();
    }

    void EditSerach() {

        x.IndexID = Integer.parseInt(jtb_search.getValue());
        x.FrameDataupdate(x.IndexID);
        x.editStep1();

        jtab_data.setSelectedIndex(0);
    }

    void updateULable() {

        jtab_data.setTitleAt(1, po.getWord("label.thisSearch"));
        jtab_data.setTitleAt(0, po.getWord("label.home"));

        jtab_data.setTitleAt(2, po.getWord("label.threportes"));

    }

    void updateTemplat() {
        x.TabelString = TABLE_treasury_otherEx;
        x.panels = new JPanel[]{data_panel};

        x.reportIndex = jtab_rep_names;

        x.serachTabel = jtb_search;
        x.ActionsButtons.put("add", jbt_add);
        /* p.ActionsButtons.put("cancel", jbt_cancel);*/
        x.ActionsButtons.put("edit", jbt_edit);
        x.ActionsButtons.put("delete", jbt_delete);

        x.dataComponents = new Component[]{
            jtxt_code, jsp_amount,
            jd_date,
            jcom_treasury,
            jcom_official,
            jcom_exfor,
            jta_more};

        x.dataSaveFields = new String[]{
            "code",
            "amount",
            "date",
            "treasury_id",
            "official_id",
            "exfor_id",
            "more"};

        jtxt_code.setTable(x.TabelString);
        x.dataViewAS = new String[]{
            "id_hide", "_minwidth", "_midwidth", "date_midwidth", "addsTreeID_midWidth", "addsTreeID_midWidth", "addsTreeID_maxWidth", "_minwidth"
        };
        deleteAttars();
    }

    void deleteAttars() {
        x.deleteTabel = jtab_indexDelete;
        jtab_data.setTitleAt(3, po.getWord("label.deletefiles"));
        jtab_data.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {

                if (jtab_data.getSelectedIndex() == 3) {

                    x.indexdelete();
                }
            }
        });

    }

    void updateindex() {

        String where = "";
        if (jd_date.getDate() != null) {
            where = ac.lib.data.dateTime.updateSerechDate("date", jd_date.getDate()) + " and ";
        }
        x.Where = where + " 1=1 ";

        x.serachTabel = jtb_index;
        x.indexsearch();

    }

    void doDelete() {
        try {

            String[] prossData = x.getRow("" + x.IndexID);

            String tid = prossData[2];
            double am = Double.parseDouble(prossData[7]);

            if (x.setdeleteStatus(true, false, false) == 1) {
                //Process
                x.reProcess(tid, am);
                //Process  
                ac.GUI.index.updateTinfo(tid, true);
            }
        } catch (Exception ex) {
        };
        updateindex();

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jtab_data = new ac.ui.controls.PCLTabs();
        pCLPanel3 = new ac.ui.controls.PCLPanel();
        jScrollPane11 = new javax.swing.JScrollPane();
        jtb_index = new ac.ui.controls.PCLTable();
        data_panel = new ac.ui.controls.PCLPanel();
        jd_date = new ac.ui.controls.PCLDate();
        jcom_treasury = new ac.ui.controls.PCLGetdataFull();
        pCLLabel23 = new ac.ui.controls.PCLLabel();
        jcom_official = new ac.ui.controls.PCLGetdataFull();
        pCLLabel11 = new ac.ui.controls.PCLLabel();
        jcom_exfor = new ac.ui.controls.PCLGetdataFull();
        pCLLabel18 = new ac.ui.controls.PCLLabel();
        pCLLabel19 = new ac.ui.controls.PCLLabel();
        jScrollPane12 = new javax.swing.JScrollPane();
        jta_more = new ac.ui.controls.PCLTextarea();
        pCLLabel24 = new ac.ui.controls.PCLLabel();
        jtxt_code = new ac.ui.controls.PCLCode();
        pCLLabel17 = new ac.ui.controls.PCLLabel();
        jsp_amount = new ac.ui.controls.PCLMoney();
        pCLLabel25 = new ac.ui.controls.PCLLabel();
        pCLToolbar2 = new ac.ui.controls.PCLToolbar();
        jbt_add = new ac.ui.controls.PCLButton();
        jbt_edit = new ac.ui.controls.PCLButton();
        jbt_delete = new ac.ui.controls.PCLButton();
        jbt_print = new ac.ui.controls.PCLButton();
        jbt_print2 = new ac.ui.controls.PCLButton();
        jXLabel1 = new org.jdesktop.swingx.JXLabel();
        jbt_cancel = new ac.ui.controls.PCLButton();
        pCLPanel1 = new ac.ui.controls.PCLPanel();
        jPanel1 = new javax.swing.JPanel();
        jcom_search = new ac.ui.controls.PCLcomboBox();
        pCLLabel2 = new ac.ui.controls.PCLLabel();
        pCLLabel1 = new ac.ui.controls.PCLLabel();
        pCLButton1 = new ac.ui.controls.PCLButton();
        jtxt_search = new ac.ui.controls.PCLTextField();
        jd_dateSearch = new ac.ui.controls.PCLDate();
        pCLLabel20 = new ac.ui.controls.PCLLabel();
        jPanel2 = new javax.swing.JPanel();
        pCLToolbar8 = new ac.ui.controls.PCLToolbar();
        jbt_edit1 = new ac.ui.controls.PCLButton();
        jbt_delete1 = new ac.ui.controls.PCLButton();
        jbt_print1 = new ac.ui.controls.PCLButton();
        jbt_print3 = new ac.ui.controls.PCLButton();
        jScrollPane5 = new javax.swing.JScrollPane();
        jtb_search = new ac.ui.controls.PCLTable();
        jPanel5 = new javax.swing.JPanel();
        jp_retportNames = new ac.ui.controls.PCLPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        jtab_rep_names = new ac.ui.controls.PCLTable();
        jScrollPane9 = new javax.swing.JScrollPane();
        jtr_rep_category = new ac.ui.controls.PCLTree();
        jp_retportTaype = new ac.ui.controls.PCLPanel();
        jScrollPane8 = new javax.swing.JScrollPane();
        jtr_rep_type = new ac.ui.controls.PCLTree();
        jScrollPane10 = new javax.swing.JScrollPane();
        pCLTextarea1 = new ac.ui.controls.PCLTextarea();
        jp_retportcon = new ac.ui.controls.PCLPanel();
        jd_rep_view = new ac.ui.controls.PCLButton();
        jd_rep_to = new ac.ui.controls.PCLDate();
        pCLLabel22 = new ac.ui.controls.PCLLabel();
        jd_rep_from = new ac.ui.controls.PCLDate();
        pCLLabel21 = new ac.ui.controls.PCLLabel();
        jlb_repTitle = new ac.ui.controls.PCLLabel();
        pCLPanel4 = new ac.ui.controls.PCLPanel();
        jScrollPane13 = new javax.swing.JScrollPane();
        jtab_indexDelete = new ac.ui.controls.PCLTable();
        pCLToolbar9 = new ac.ui.controls.PCLToolbar();
        jbt_remove = new ac.ui.controls.PCLButton();
        jbt_removeAll = new ac.ui.controls.PCLButton();
        jbt_restore = new ac.ui.controls.PCLButton();
        jbt_restoreAll = new ac.ui.controls.PCLButton();

        jtab_data.setTabPlacement(javax.swing.JTabbedPane.RIGHT);

        jtb_index.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtb_indexMouseClicked(evt);
            }
        });
        jScrollPane11.setViewportView(jtb_index);

        jd_date.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jd_dateMouseClicked(evt);
            }
        });
        jd_date.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jd_dateActionPerformed(evt);
            }
        });
        jd_date.addHierarchyListener(new java.awt.event.HierarchyListener() {
            public void hierarchyChanged(java.awt.event.HierarchyEvent evt) {
                jd_dateHierarchyChanged(evt);
            }
        });

        jcom_treasury.setRequired(true);
        jcom_treasury.setAddtype("treasuryType");
        jcom_treasury.setCategory(true);
        jcom_treasury.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcom_treasuryActionPerformed(evt);
            }
        });

        pCLLabel23.setText("jlb_more");

        jcom_official.setRequired(true);
        jcom_official.setAddtype("official");
        jcom_official.setCategory(true);

        pCLLabel11.setText("jlb_exFor");

        jcom_exfor.setRequired(true);
        jcom_exfor.setAddtype("exfor");
        jcom_exfor.setCategory(true);
        jcom_exfor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcom_exforActionPerformed(evt);
            }
        });

        pCLLabel18.setText("jlb_Official");

        pCLLabel19.setText("jlb_date");

        jta_more.setColumns(20);
        jta_more.setRows(5);
        jScrollPane12.setViewportView(jta_more);

        pCLLabel24.setText("jlb_treasury");

        jtxt_code.setAuto(true);
        jtxt_code.setChiked(true);
        jtxt_code.setTable("treasury_otherex");
        jtxt_code.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtxt_codeActionPerformed(evt);
            }
        });

        pCLLabel17.setText("jlb_code");

        pCLLabel25.setText("jlb_amount");

        javax.swing.GroupLayout data_panelLayout = new javax.swing.GroupLayout(data_panel);
        data_panel.setLayout(data_panelLayout);
        data_panelLayout.setHorizontalGroup(
            data_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(data_panelLayout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addGroup(data_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pCLLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pCLLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pCLLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pCLLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(data_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jcom_treasury, javax.swing.GroupLayout.DEFAULT_SIZE, 247, Short.MAX_VALUE)
                    .addComponent(jcom_official, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jcom_exfor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jd_date, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(data_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pCLLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pCLLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pCLLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(data_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
                    .addComponent(jtxt_code, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jsp_amount, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        data_panelLayout.setVerticalGroup(
            data_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(data_panelLayout.createSequentialGroup()
                .addGroup(data_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jd_date, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pCLLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtxt_code, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pCLLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(data_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jcom_treasury, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pCLLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(data_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jsp_amount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(pCLLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(data_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(data_panelLayout.createSequentialGroup()
                        .addGroup(data_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jcom_official, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(pCLLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(pCLLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(10, 10, 10)
                        .addGroup(data_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jcom_exfor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(pCLLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap())
        );

        pCLToolbar2.setRollover(true);

        jbt_add.setType("add");
        jbt_add.setFocusable(false);
        jbt_add.setText("jbt_add");
        jbt_add.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_addActionPerformed(evt);
            }
        });
        pCLToolbar2.add(jbt_add);

        jbt_edit.setType("edit");
        jbt_edit.setFocusable(false);
        jbt_edit.setText("jbt_edit");
        jbt_edit.setVerticalTextPosition(3);
        jbt_edit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_editActionPerformed(evt);
            }
        });
        pCLToolbar2.add(jbt_edit);

        jbt_delete.setType("delete");
        jbt_delete.setFocusable(false);
        jbt_delete.setText("jbt_delete");
        jbt_delete.setVerticalTextPosition(3);
        jbt_delete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_deleteActionPerformed(evt);
            }
        });
        pCLToolbar2.add(jbt_delete);

        jbt_print.setType("print");
        jbt_print.setFocusable(false);
        jbt_print.setText("jbt_printReceipt");
        jbt_print.setVerticalTextPosition(3);
        jbt_print.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_printActionPerformed(evt);
            }
        });
        pCLToolbar2.add(jbt_print);

        jbt_print2.setType("print");
        jbt_print2.setFocusable(false);
        jbt_print2.setText("jbt_print");
        jbt_print2.setVerticalTextPosition(3);
        jbt_print2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_print2ActionPerformed(evt);
            }
        });
        pCLToolbar2.add(jbt_print2);

        jXLabel1.setBorder(javax.swing.BorderFactory.createCompoundBorder());
        jXLabel1.setIconTextGap(0);
        jXLabel1.setMaximumSize(new java.awt.Dimension(50, 14));
        jXLabel1.setPreferredSize(new java.awt.Dimension(50, 14));
        pCLToolbar2.add(jXLabel1);

        jbt_cancel.setType("cancel");
        jbt_cancel.setFocusable(false);
        jbt_cancel.setText("jbt_cancel");
        jbt_cancel.setVerticalTextPosition(3);
        jbt_cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_cancelActionPerformed(evt);
            }
        });
        pCLToolbar2.add(jbt_cancel);

        javax.swing.GroupLayout pCLPanel3Layout = new javax.swing.GroupLayout(pCLPanel3);
        pCLPanel3.setLayout(pCLPanel3Layout);
        pCLPanel3Layout.setHorizontalGroup(
            pCLPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 681, Short.MAX_VALUE)
            .addComponent(data_panel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(pCLToolbar2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
        );
        pCLPanel3Layout.setVerticalGroup(
            pCLPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pCLPanel3Layout.createSequentialGroup()
                .addComponent(data_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pCLToolbar2, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 223, Short.MAX_VALUE))
        );

        jtab_data.addTab("tab4", pCLPanel3);

        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray));

        pCLLabel2.setText("jlb_searchWord");

        pCLLabel1.setText("jlb_searchIn");

        pCLButton1.setText("jbt_search");
        pCLButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pCLButton1ActionPerformed(evt);
            }
        });

        jd_dateSearch.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jd_dateSearchMouseClicked(evt);
            }
        });
        jd_dateSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jd_dateSearchActionPerformed(evt);
            }
        });
        jd_dateSearch.addHierarchyListener(new java.awt.event.HierarchyListener() {
            public void hierarchyChanged(java.awt.event.HierarchyEvent evt) {
                jd_dateSearchHierarchyChanged(evt);
            }
        });

        pCLLabel20.setText("jlb_date");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pCLButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jcom_search, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(pCLLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(pCLLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(pCLLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 98, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jtxt_search, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addComponent(jd_dateSearch, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(pCLLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jd_dateSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(21, 21, 21)
                .addComponent(pCLLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jcom_search, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(12, 12, 12)
                .addComponent(pCLLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jtxt_search, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(pCLButton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(113, Short.MAX_VALUE))
        );

        pCLToolbar8.setRollover(true);

        jbt_edit1.setType("edit");
        jbt_edit1.setFocusable(false);
        jbt_edit1.setText("jbt_edit");
        jbt_edit1.setVerticalTextPosition(3);
        jbt_edit1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_edit1ActionPerformed(evt);
            }
        });
        pCLToolbar8.add(jbt_edit1);

        jbt_delete1.setType("delete");
        jbt_delete1.setFocusable(false);
        jbt_delete1.setText("jbt_delete");
        jbt_delete1.setVerticalTextPosition(3);
        jbt_delete1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_delete1ActionPerformed(evt);
            }
        });
        pCLToolbar8.add(jbt_delete1);

        jbt_print1.setType("print");
        jbt_print1.setFocusable(false);
        jbt_print1.setText("jbt_print");
        jbt_print1.setVerticalTextPosition(3);
        jbt_print1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_print1ActionPerformed(evt);
            }
        });
        pCLToolbar8.add(jbt_print1);

        jbt_print3.setType("print");
        jbt_print3.setFocusable(false);
        jbt_print3.setHorizontalTextPosition(0);
        jbt_print3.setText("jbt_printReceipt");
        jbt_print3.setVerticalTextPosition(3);
        jbt_print3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_print3ActionPerformed(evt);
            }
        });
        pCLToolbar8.add(jbt_print3);

        jtb_search.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtb_searchMouseClicked(evt);
            }
        });
        jScrollPane5.setViewportView(jtb_search);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pCLToolbar8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addGap(0, 0, 0))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(pCLToolbar8, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout pCLPanel1Layout = new javax.swing.GroupLayout(pCLPanel1);
        pCLPanel1.setLayout(pCLPanel1Layout);
        pCLPanel1Layout.setHorizontalGroup(
            pCLPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pCLPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(464, Short.MAX_VALUE))
            .addGroup(pCLPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pCLPanel1Layout.createSequentialGroup()
                    .addGap(216, 216, 216)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        pCLPanel1Layout.setVerticalGroup(
            pCLPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pCLPanel1Layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(1, 1, 1))
            .addGroup(pCLPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jtab_data.addTab("jtab_index", pCLPanel1);

        jp_retportNames.setBorder(javax.swing.BorderFactory.createTitledBorder("aaaaa"));

        jtab_rep_names.setType("index");
        jtab_rep_names.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtab_rep_namesMouseClicked(evt);
            }
        });
        jtab_rep_names.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jtab_rep_namesKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtab_rep_namesKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jtab_rep_namesKeyTyped(evt);
            }
        });
        jScrollPane7.setViewportView(jtab_rep_names);

        javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root");
        jtr_rep_category.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
        jtr_rep_category.setAddtype("productsCat");
        jtr_rep_category.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
            public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {
                jtr_rep_categoryValueChanged(evt);
            }
        });
        jScrollPane9.setViewportView(jtr_rep_category);

        javax.swing.GroupLayout jp_retportNamesLayout = new javax.swing.GroupLayout(jp_retportNames);
        jp_retportNames.setLayout(jp_retportNamesLayout);
        jp_retportNamesLayout.setHorizontalGroup(
            jp_retportNamesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
            .addComponent(jScrollPane9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE)
        );
        jp_retportNamesLayout.setVerticalGroup(
            jp_retportNamesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jp_retportNamesLayout.createSequentialGroup()
                .addGap(11, 11, 11)
                .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
        );

        jp_retportTaype.setBorder(javax.swing.BorderFactory.createTitledBorder("aaaaa"));
        jp_retportTaype.setPreferredSize(new java.awt.Dimension(200, 282));

        treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root");
        jtr_rep_type.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
        jtr_rep_type.setAddtype("proRepType");
        jtr_rep_type.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
            public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {
                jtr_rep_typeValueChanged(evt);
            }
        });
        jScrollPane8.setViewportView(jtr_rep_type);

        pCLTextarea1.setBackground(new java.awt.Color(255, 255, 204));
        pCLTextarea1.setColumns(20);
        pCLTextarea1.setRows(5);
        jScrollPane10.setViewportView(pCLTextarea1);

        javax.swing.GroupLayout jp_retportTaypeLayout = new javax.swing.GroupLayout(jp_retportTaype);
        jp_retportTaype.setLayout(jp_retportTaypeLayout);
        jp_retportTaypeLayout.setHorizontalGroup(
            jp_retportTaypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane8)
            .addComponent(jScrollPane10, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE)
        );
        jp_retportTaypeLayout.setVerticalGroup(
            jp_retportTaypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jp_retportTaypeLayout.createSequentialGroup()
                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 283, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 26, Short.MAX_VALUE))
        );

        jp_retportcon.setBorder(javax.swing.BorderFactory.createTitledBorder("aaaaa"));

        jd_rep_view.setText("jbt_search");
        jd_rep_view.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jd_rep_viewActionPerformed(evt);
            }
        });

        pCLLabel22.setText("jlb_To");

        pCLLabel21.setText("jlb_From");

        javax.swing.GroupLayout jp_retportconLayout = new javax.swing.GroupLayout(jp_retportcon);
        jp_retportcon.setLayout(jp_retportconLayout);
        jp_retportconLayout.setHorizontalGroup(
            jp_retportconLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jd_rep_view, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
            .addComponent(jd_rep_to, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jd_rep_from, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jp_retportconLayout.createSequentialGroup()
                .addComponent(pCLLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
            .addGroup(jp_retportconLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pCLLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jp_retportconLayout.setVerticalGroup(
            jp_retportconLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jp_retportconLayout.createSequentialGroup()
                .addGap(17, 17, 17)
                .addComponent(pCLLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jd_rep_from, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pCLLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jd_rep_to, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jd_rep_view, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jlb_repTitle.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jlb_repTitle.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlb_repTitle.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jlb_repTitle.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jp_retportTaype, javax.swing.GroupLayout.DEFAULT_SIZE, 214, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jp_retportNames, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jp_retportcon, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jlb_repTitle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jlb_repTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jp_retportTaype, javax.swing.GroupLayout.DEFAULT_SIZE, 338, Short.MAX_VALUE)
                    .addComponent(jp_retportNames, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jp_retportcon, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        jtab_data.addTab("tab3", jPanel5);

        jtab_indexDelete.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jtab_indexDelete.setType("index");
        jtab_indexDelete.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtab_indexDeleteMouseClicked(evt);
            }
        });
        jtab_indexDelete.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jtab_indexDeletePropertyChange(evt);
            }
        });
        jtab_indexDelete.addInputMethodListener(new java.awt.event.InputMethodListener() {
            public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
            }
            public void caretPositionChanged(java.awt.event.InputMethodEvent evt) {
                jtab_indexDeleteCaretPositionChanged(evt);
            }
        });
        jtab_indexDelete.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jtab_indexDeleteKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtab_indexDeleteKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jtab_indexDeleteKeyTyped(evt);
            }
        });
        jtab_indexDelete.addVetoableChangeListener(new java.beans.VetoableChangeListener() {
            public void vetoableChange(java.beans.PropertyChangeEvent evt)throws java.beans.PropertyVetoException {
                jtab_indexDeleteVetoableChange(evt);
            }
        });
        jScrollPane13.setViewportView(jtab_indexDelete);

        pCLToolbar9.setRollover(true);

        jbt_remove.setType("remove");
        jbt_remove.setFocusable(false);
        jbt_remove.setText("jbt_remove");
        jbt_remove.setVerticalTextPosition(3);
        jbt_remove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_removeActionPerformed(evt);
            }
        });
        pCLToolbar9.add(jbt_remove);

        jbt_removeAll.setType("removeAll");
        jbt_removeAll.setFocusable(false);
        jbt_removeAll.setText("jbt_removeAll");
        jbt_removeAll.setVerticalTextPosition(3);
        jbt_removeAll.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_removeAllActionPerformed(evt);
            }
        });
        pCLToolbar9.add(jbt_removeAll);

        jbt_restore.setType("restore");
        jbt_restore.setFocusable(false);
        jbt_restore.setText("jbt_restore");
        jbt_restore.setVerticalTextPosition(3);
        jbt_restore.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_restoreActionPerformed(evt);
            }
        });
        pCLToolbar9.add(jbt_restore);

        jbt_restoreAll.setType("restoreAll");
        jbt_restoreAll.setFocusable(false);
        jbt_restoreAll.setText("jbt_restoreAll");
        jbt_restoreAll.setVerticalTextPosition(3);
        jbt_restoreAll.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_restoreAllActionPerformed(evt);
            }
        });
        pCLToolbar9.add(jbt_restoreAll);

        javax.swing.GroupLayout pCLPanel4Layout = new javax.swing.GroupLayout(pCLPanel4);
        pCLPanel4.setLayout(pCLPanel4Layout);
        pCLPanel4Layout.setHorizontalGroup(
            pCLPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane13, javax.swing.GroupLayout.DEFAULT_SIZE, 681, Short.MAX_VALUE)
            .addComponent(pCLToolbar9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        pCLPanel4Layout.setVerticalGroup(
            pCLPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pCLPanel4Layout.createSequentialGroup()
                .addComponent(pCLToolbar9, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane13, javax.swing.GroupLayout.DEFAULT_SIZE, 339, Short.MAX_VALUE))
        );

        jtab_data.addTab("tab4", pCLPanel4);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jtab_data, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jtab_data, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jcom_exforActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcom_exforActionPerformed

    }//GEN-LAST:event_jcom_exforActionPerformed

    private void jcom_treasuryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcom_treasuryActionPerformed
        String tid = custemItmes.comBoxGetValue(jcom_treasury);

        ac.GUI.index.updateTinfo(tid, true);
    }//GEN-LAST:event_jcom_treasuryActionPerformed

    private void jtb_indexMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtb_indexMouseClicked
        x.IndexID = Integer.parseInt(jtb_index.getValue());
    }//GEN-LAST:event_jtb_indexMouseClicked

    private void jd_rep_viewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jd_rep_viewActionPerformed


    }//GEN-LAST:event_jd_rep_viewActionPerformed

    private void jtr_rep_typeValueChanged(javax.swing.event.TreeSelectionEvent evt) {//GEN-FIRST:event_jtr_rep_typeValueChanged

    }//GEN-LAST:event_jtr_rep_typeValueChanged

    private void jtr_rep_categoryValueChanged(javax.swing.event.TreeSelectionEvent evt) {//GEN-FIRST:event_jtr_rep_categoryValueChanged


    }//GEN-LAST:event_jtr_rep_categoryValueChanged

    private void jtab_rep_namesKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtab_rep_namesKeyTyped
    }//GEN-LAST:event_jtab_rep_namesKeyTyped

    private void jtab_rep_namesKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtab_rep_namesKeyReleased
    }//GEN-LAST:event_jtab_rep_namesKeyReleased

    private void jtab_rep_namesKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtab_rep_namesKeyPressed
    }//GEN-LAST:event_jtab_rep_namesKeyPressed

    private void jtab_rep_namesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtab_rep_namesMouseClicked
    }//GEN-LAST:event_jtab_rep_namesMouseClicked

    private void jtb_searchMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtb_searchMouseClicked

        x.IndexID = Integer.parseInt(jtb_search.getValue());
    }//GEN-LAST:event_jtb_searchMouseClicked

    private void jbt_print1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_print1ActionPerformed
        x.setPrint(REPORT_treasury_ex_file_print, sqlQuerys.SQL_treasuryEX_File + x.IndexID);

    }//GEN-LAST:event_jbt_print1ActionPerformed

    private void jbt_delete1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_delete1ActionPerformed

        x.IndexID = Integer.parseInt(jtb_search.getValue());

        doDelete();

    }//GEN-LAST:event_jbt_delete1ActionPerformed

    private void jbt_edit1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_edit1ActionPerformed
        EditSerach();
    }//GEN-LAST:event_jbt_edit1ActionPerformed

    private void pCLButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pCLButton1ActionPerformed

        // TODO add your handling code here:
        String where = "";

        String seword = jtxt_search.getText();

        if (jd_dateSearch.getDate() != null) {
            where = ac.lib.data.dateTime.updateSerechDate("date", jd_dateSearch.getDate()) + " and ";
        }
        if (!seword.equals("")) {

            where += "`" + ac.ui.utils.comBoxGetValue(jcom_search) + "`like '%" + jtxt_search.getText() + "%' and ";
        }

        x.Where = where + " 1=1 ";

        x.serachTabel = jtb_search;
        x.indexsearch();

        x.serachTabel = jtb_index;
        x.indexsearch();


    }//GEN-LAST:event_pCLButton1ActionPerformed

    private void jbt_addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_addActionPerformed
        try {
            x.dataSaveValues = ac.ui.utils.getDataFromComss(x.dataComponents);
            double am = Double.parseDouble(jsp_amount.getValue().toString());
            if (x.setnewRetuenSataus(true, false, false, false, false) > 0) {
                //Process

                String tid = custemItmes.comBoxGetValue(jcom_treasury);
                x.doProcess(tid, am);
                //Process
                ac.GUI.index.updateTinfo(tid, true);
            }
            updateindex();
        } catch (Exception ex) {
        };
    }//GEN-LAST:event_jbt_addActionPerformed

    private void jbt_editActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_editActionPerformed
        try {

            String[] prossData = x.getRow("" + x.IndexID);

            String tid = prossData[2];
            double am = Double.parseDouble(prossData[7]);

            x.dataSaveValues = ac.ui.utils.getDataFromComss(x.dataComponents);
            
            x.FrameDataupdateByid( x.IndexID);
            
            if (x.seteditRetuenSataus(true, false, false) > 0) {
                x.reProcess(tid, am);

                prossData = x.getRow("" + x.IndexID);

                tid = prossData[2];
                am = Double.parseDouble(prossData[7]);
                x.doProcess(tid, am);
                ac.GUI.index.updateTinfo(tid, true);
                
                
            }
        } catch (Exception ex) {
        };
        updateindex();
    }//GEN-LAST:event_jbt_editActionPerformed

    private void jbt_deleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_deleteActionPerformed

        x.IndexID = Integer.parseInt(jtb_index.getValue());
        doDelete();


    }//GEN-LAST:event_jbt_deleteActionPerformed

    private void jbt_printActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_printActionPerformed

        x.setPrint(REPORT_treasury_ex_receipt_print, sqlQuerys.SQL_treasuryEX_File + x.IndexID);

    }//GEN-LAST:event_jbt_printActionPerformed

    private void jbt_cancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_cancelActionPerformed


    }//GEN-LAST:event_jbt_cancelActionPerformed

    private void jtxt_codeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtxt_codeActionPerformed

    }//GEN-LAST:event_jtxt_codeActionPerformed

    private void jd_dateHierarchyChanged(java.awt.event.HierarchyEvent evt) {//GEN-FIRST:event_jd_dateHierarchyChanged


    }//GEN-LAST:event_jd_dateHierarchyChanged

    private void jd_dateMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jd_dateMouseClicked

    }//GEN-LAST:event_jd_dateMouseClicked

    private void jd_dateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jd_dateActionPerformed
        updateindex();
    }//GEN-LAST:event_jd_dateActionPerformed

    private void jd_dateSearchMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jd_dateSearchMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jd_dateSearchMouseClicked

    private void jd_dateSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jd_dateSearchActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jd_dateSearchActionPerformed

    private void jd_dateSearchHierarchyChanged(java.awt.event.HierarchyEvent evt) {//GEN-FIRST:event_jd_dateSearchHierarchyChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_jd_dateSearchHierarchyChanged

    private void jbt_print2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_print2ActionPerformed
        x.setPrint(REPORT_treasury_ex_file_print, sqlQuerys.SQL_treasuryEX_File + x.IndexID);
    }//GEN-LAST:event_jbt_print2ActionPerformed

    private void jbt_print3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_print3ActionPerformed
        x.setPrint(REPORT_treasury_ex_receipt_print, sqlQuerys.SQL_treasuryEX_File + x.IndexID);

    }//GEN-LAST:event_jbt_print3ActionPerformed

    private void jtab_indexDeleteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtab_indexDeleteMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jtab_indexDeleteMouseClicked

    private void jtab_indexDeletePropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jtab_indexDeletePropertyChange
        // TODO add your handling code here:
    }//GEN-LAST:event_jtab_indexDeletePropertyChange

    private void jtab_indexDeleteCaretPositionChanged(java.awt.event.InputMethodEvent evt) {//GEN-FIRST:event_jtab_indexDeleteCaretPositionChanged

    }//GEN-LAST:event_jtab_indexDeleteCaretPositionChanged

    private void jtab_indexDeleteKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtab_indexDeleteKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtab_indexDeleteKeyPressed

    private void jtab_indexDeleteKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtab_indexDeleteKeyReleased
        // TODO add your handling code here:
    }//GEN-LAST:event_jtab_indexDeleteKeyReleased

    private void jtab_indexDeleteKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtab_indexDeleteKeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_jtab_indexDeleteKeyTyped

    private void jtab_indexDeleteVetoableChange(java.beans.PropertyChangeEvent evt)throws java.beans.PropertyVetoException {//GEN-FIRST:event_jtab_indexDeleteVetoableChange

    }//GEN-LAST:event_jtab_indexDeleteVetoableChange

    private void jbt_removeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_removeActionPerformed

        x.setRemove(Integer.parseInt(d.IndexGetValue(x.deleteTabel)));
        x.indexdelete();
    }//GEN-LAST:event_jbt_removeActionPerformed

    private void jbt_removeAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_removeAllActionPerformed
        x.setRemoveAll();
        x.indexdelete();
    }//GEN-LAST:event_jbt_removeAllActionPerformed

    void myDoPross(String id) {

        String[] prossData = x.getRow(id);

        String tid = prossData[2];
        double am = Double.parseDouble(prossData[7]);
        x.doProcess(tid, am);

    }


    private void jbt_restoreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_restoreActionPerformed
        x.setRestore(Integer.parseInt(d.IndexGetValue(x.deleteTabel)));
        myDoPross(d.IndexGetValue(x.deleteTabel));
        x.indexdelete();
    }//GEN-LAST:event_jbt_restoreActionPerformed

    private void jbt_restoreAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_restoreAllActionPerformed
        try {
            ac.lib.database.operations db = new ac.lib.database.operations();

            db.setOpenCon();

            ResultSet r = db.getDataWithOutCon(x.TabelString, "*", "rowstatus ='" + rowDeleted + "'");
            while (r.next()) {

                myDoPross(r.getString("id"));

            }

            db.setCloseCon();

            x.setRestoreAll();
            x.indexdelete();
        } catch (SQLException ex) {
            Logger.getLogger(otherEx.class.getName()).log(Level.SEVERE, null, ex);
        }


    }//GEN-LAST:event_jbt_restoreAllActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private ac.ui.controls.PCLPanel data_panel;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private org.jdesktop.swingx.JXLabel jXLabel1;
    private ac.ui.controls.PCLButton jbt_add;
    private ac.ui.controls.PCLButton jbt_cancel;
    private ac.ui.controls.PCLButton jbt_delete;
    private ac.ui.controls.PCLButton jbt_delete1;
    private ac.ui.controls.PCLButton jbt_edit;
    private ac.ui.controls.PCLButton jbt_edit1;
    private ac.ui.controls.PCLButton jbt_print;
    private ac.ui.controls.PCLButton jbt_print1;
    private ac.ui.controls.PCLButton jbt_print2;
    private ac.ui.controls.PCLButton jbt_print3;
    private ac.ui.controls.PCLButton jbt_remove;
    private ac.ui.controls.PCLButton jbt_removeAll;
    private ac.ui.controls.PCLButton jbt_restore;
    private ac.ui.controls.PCLButton jbt_restoreAll;
    private ac.ui.controls.PCLGetdataFull jcom_exfor;
    private ac.ui.controls.PCLGetdataFull jcom_official;
    private ac.ui.controls.PCLcomboBox jcom_search;
    private ac.ui.controls.PCLGetdataFull jcom_treasury;
    private ac.ui.controls.PCLDate jd_date;
    private ac.ui.controls.PCLDate jd_dateSearch;
    private ac.ui.controls.PCLDate jd_rep_from;
    private ac.ui.controls.PCLDate jd_rep_to;
    private ac.ui.controls.PCLButton jd_rep_view;
    private ac.ui.controls.PCLLabel jlb_repTitle;
    private ac.ui.controls.PCLPanel jp_retportNames;
    private ac.ui.controls.PCLPanel jp_retportTaype;
    private ac.ui.controls.PCLPanel jp_retportcon;
    private ac.ui.controls.PCLMoney jsp_amount;
    private ac.ui.controls.PCLTextarea jta_more;
    private ac.ui.controls.PCLTabs jtab_data;
    private ac.ui.controls.PCLTable jtab_indexDelete;
    private ac.ui.controls.PCLTable jtab_rep_names;
    private ac.ui.controls.PCLTable jtb_index;
    private ac.ui.controls.PCLTable jtb_search;
    private ac.ui.controls.PCLTree jtr_rep_category;
    private ac.ui.controls.PCLTree jtr_rep_type;
    private ac.ui.controls.PCLCode jtxt_code;
    private ac.ui.controls.PCLTextField jtxt_search;
    private ac.ui.controls.PCLButton pCLButton1;
    private ac.ui.controls.PCLLabel pCLLabel1;
    private ac.ui.controls.PCLLabel pCLLabel11;
    private ac.ui.controls.PCLLabel pCLLabel17;
    private ac.ui.controls.PCLLabel pCLLabel18;
    private ac.ui.controls.PCLLabel pCLLabel19;
    private ac.ui.controls.PCLLabel pCLLabel2;
    private ac.ui.controls.PCLLabel pCLLabel20;
    private ac.ui.controls.PCLLabel pCLLabel21;
    private ac.ui.controls.PCLLabel pCLLabel22;
    private ac.ui.controls.PCLLabel pCLLabel23;
    private ac.ui.controls.PCLLabel pCLLabel24;
    private ac.ui.controls.PCLLabel pCLLabel25;
    private ac.ui.controls.PCLPanel pCLPanel1;
    private ac.ui.controls.PCLPanel pCLPanel3;
    private ac.ui.controls.PCLPanel pCLPanel4;
    private ac.ui.controls.PCLTextarea pCLTextarea1;
    private ac.ui.controls.PCLToolbar pCLToolbar2;
    private ac.ui.controls.PCLToolbar pCLToolbar8;
    private ac.ui.controls.PCLToolbar pCLToolbar9;
    // End of variables declaration//GEN-END:variables
}
